package com.lcxw.hxzbapi.controller.economycontroller;

import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.lcxw.hxzbapi.service.CoinService;
import com.lcxw.hxzbapi.service.YwpdMemberService;

/**
 * @author Administrator
 */
@Component
public class CoinRealization {

    @Resource
    YwpdMemberService ywpdMemberService;

    @Resource
    CoinService coinService;

    int getMemberCoin(long userId) throws Exception {
        return ywpdMemberService.selectYwpdMemberByUserId(userId).getEarnBean();
    }

    int getRatio(){
        return coinService.getRatio();
    }

    void updateCoin(int coin,long userId){
        ywpdMemberService.updateCoinByUserId(coin,userId);
    }
}
